#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back
#define vec vector<int>
#define y1 y___dfkjakaj_1

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);return x*sgn;}

const int N = 8e4 + 10;

struct edge{int v,nxt;}e[N<<2];
int n,m,t;
int fa[N],f[22][N],a[N],b[N],cnt,tot,h[N],siz[N],ndn,rt[N],dep[N];
int s[N<<7],ls[N<<7],rs[N<<7];
void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}

int gf(int x){return fa[x] == x ? x : fa[x] = gf(fa[x]);}

int lca(int x,int y){if(dep[x] < dep[y]) swap(x,y); for(int i = 20;i >= 0;i--) if(dep[f[i][x]] >= dep[y]) x = f[i][x]; if(x == y) return x; for(int i = 20;i >= 0;i--) if(f[i][x] ^ f[i][y]) x = f[i][x],y = f[i][y]; return f[0][x];}

void upd(int &y,int x,int v,int l = 1,int r = tot){
	y = ++ndn; s[y] = s[x] + 1; ls[y] = ls[x]; rs[y] = rs[x]; if(l == r) return; int mid = l + r >> 1;
	if(v <= mid) upd(ls[y],ls[x],v,l,mid); else if(v > mid) upd(rs[y],rs[x],v,mid+1,r);	
}

int query(int y1,int x1,int y2,int x2,int k,int l = 1,int r = tot){
	if(l == r) return l; int mid = l + r >> 1;
	int s1 = s[ls[y1]] - s[ls[x1]] + s[ls[y2]] - s[ls[x2]];
	if(s1 < k) return query(rs[y1],rs[x1],rs[y2],rs[x2],k - s1,mid + 1,r);
	else return query(ls[y1],ls[x1],ls[y2],ls[x2],k,l,mid);
}

void dfs(int x,int p){
	f[0][x] = p; for(int i = 1;i <= 20;i++) f[i][x] = f[i-1][f[i-1][x]]; dep[x] = dep[p] + 1; siz[x] = 1;
	upd(rt[x],rt[p],a[x]);
	for(int i = h[x],y;i;i = e[i].nxt) if((y = e[i].v) ^ p) dfs(y,x),siz[x] += siz[y];
}

int qry(int x,int y,int k){int L = lca(x,y); return query(rt[x],rt[L],rt[y],rt[f[0][L]],k);}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	in;
	n = in,m = in,t = in;
	for(int i = 1;i <= n;i++) a[i] = b[i] = in;
	sort(b + 1,b + n + 1); tot = unique(b + 1,b + n + 1) - b - 1;
	for(int i = 1;i <= n;i++) a[i] = lower_bound(b + 1,b + tot + 1,a[i]) - b,fa[i] = i;
	for(int i = 1,u,v;i <= m;i++) u = in,v = in,link(u,v),link(v,u),fa[gf(u)] = gf(v);
	for(int i = 1;i <= n;i++) if(gf(i) == i) dfs(i,0);
	int lstans = 0;
	while(t--){
		char ch = getchar(); while(!isalpha(ch)) ch = getchar();
		int x,y,k; x = in ^ lstans,y = in ^ lstans;
		if(ch == 'Q') k = in ^ lstans,lstans = qry(x,y,k),lstans = b[lstans],printf("%d\n",lstans);
		else{
			if(siz[gf(x)] < siz[gf(y)]) swap(x,y);
			dfs(y,x); siz[gf(x)] += siz[y]; fa[gf(y)] = gf(x); link(x,y); link(y,x);
		}
	}
	return 0;
}
